<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<title>学情管理</title>
	<link rel="stylesheet" href="../css/common2.css">
</head>
<style>
	.search_img {
			position: absolute;
			right: 3%;
		}
</style>
<body>

	<div id="vue-root">
		<div class="refresh" onclick="location.reload()" v-t="'刷新'"></div>
		<input placeholder="请输入学员姓名" class="search" v-model="search.name" style="height: 33px;">
		<img src="../image/search.png" height="35" width="35" alt="" class="search_img" @click="getData0">
		<div class="table">
			<table class="table_top">
				<thead>
					<tr>
						<th>
							<input type="checkbox" class="check-box" v-model="all">
						</th>
						<th v-t="'序号'"></th>
						<th v-t="'学员'"></th>
						<th v-t="'校区'"></th>
						<th v-t="'家校共建激励方案(文 本 -时 间 -登 记 人)'"></th>
						<th v-t="'编辑/删除'"></th>
					</tr>
				</thead>
				<tbody id="list">
					<tr v-for="(student,index) in list" :key="student.id">
						<td>
							<input type="checkbox" class="check-box" v-model="student.checked">
						</td>
						<td> <span v-text="index+1"></span></td>
						<td v-text="student.name"></td>
						<td  v-text="student.schoolName"></td>
						<td >
							<div v-if="Array.isArray(student.incentiveScheme) && student.incentiveScheme.length > 0">
								<div v-for="(record, index) in student.incentiveScheme.slice(0, 3)" :key="index">
								  <span>{{ record.content }} - {{ record.times }} - {{ record.username }}</span>
								</div>
							  </div>
							  <!-- 如果学习记录为空，显示 "暂无记录" -->
							  <div v-else>
								<span>暂无记录</span>
							  </div>
						</td>
						<td>
							<div class="option">
								<div v-if="able.edit" class="edit-icon option-icon">
									<a :href="'jiLiFangAn_item.html?id='+student.id"
										style="position: absolute; left: 20%; top: 30%;">
										<img class="img" src="../image/edit.png" height="20" width="20"
											onmouseover="this.src='../image/edit_light.png'"
											onmouseout="this.src='../image/edit.png'" />
									</a>
								</div>
								<div v-if="able.del" class="delete-icon option-icon" @click="del([student.id])"
									style="position: absolute; right: 20%; top: 30%;">
									<img class="img" src="../image/delete.png" height="20" width="20"
										onmouseover="this.src='../image/delete_light.png'"
										onmouseout="this.src='../image/delete.png'" />
								</div>
							</div>
						</td>
					</tr>
				</tbody>
			</table>
		</div>
		<br>
		<div class="delete" @click="batchDelete" v-if="able.del" v-t="'批量删除'"></div>
		<ul class="pagination" v-if="pages>1">
			<li>
				<a v-if="pageNum!=1" @click="pageNum=1">«</a>
				<a class="pages-jump" v-if="pageNum!=1" @click="pageNum--">‹</a>
				<a v-text="pageNum"></a>
				<a class="pages-jump" v-if="pageNum!=pages" @click="pageNum++">›</a>
				<a v-if="pageNum!=pages" @click="pageNum=pages">»</a>
			</li>
		</ul>
	</div>

	<script src="/scriptZIP/qs.min.js"></script>
	<script src="/scriptZIP/vue.min.js"></script>
	<script src="/scriptZIP/axios.min.js"></script>

	<script src="/js/common.js"></script>
	<script src="/js/list.js"></script>
	<script src="/js/auth_util.js"></script>
	<script src="/js/i18n.js"></script>

	<script>

		setI18n({
			序号: 'No.',
			操作: 'operating',
			年级: 'student',
			添加年级: 'Add grade',
			刷新: 'Refresh',
			批量删除: 'batch deletion'
		});

		var app = new Vue(merge({
			data: {
				urls: {
					del: '/pc/student/delJl'
				}
			},
			created: function () {
				var schoolId = top_params().id;
				if (!schoolId) {
					alert('未知学校');
					throw '未知学校';
				}
				this.urls.list = '/pc/student/studentXqSchool/' + schoolId;
				this.getData();
				abled('student', this);
			},
			i18n: i18n
		}));
	</script>

</body>

</html>